class ProductionSchedule < ActiveRecord::Base
  belongs_to :order
  
  enum state: {active:0, finished:0} do 
    event :finish do 
      before do 
        finished_at = Time.now.strftime("%Y-%m-%d-%H%M%S")
        self.save
      end
      transition :active => :finished 
    end
  end
end
